unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids, MemDS, DBAccess, ExtCtrls,
  RzPanel, RzSplit, Uni;

type
  TForm1 = class(TForm)
    Btnx_1: TButton;
    ADOConnection1: TADOConnection;
    ADOTable1: TADOTable;
    ADODataSet1: TADODataSet;
    Btnx_2: TButton;
    ds1: TDataSource;
    dbgrd1: TDBGrid;
    RzSplitter1: TRzSplitter;
    UniConnection1: TUniConnection;
    procedure Btnx_1Click(Sender: TObject);
    procedure Btnx_2Click(Sender: TObject);
    procedure FormResize(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Btnx_1Click(Sender: TObject);
var
  I: integer;
  PrimaryKey: String;
begin
   //PASS
   {ADOTable1.Connection:=ADOConnection1;
   ADOTable1.TableName:='tbl_sbjl';
   ADOTable1.IndexDefs.Update;
   ADOTable1.Active:=True;

   for I:=0 to ADOTable1.Fields.Count-1 do
   begin
     ShowMessage(ADOTable1.Fields.Fields[I].ClassName);
   end;}

   ADODataSet1.Connection:=ADOConnection1;
   ADODataSet1.CommandText:='select * from tbl_sbjl';
   ADODataSet1.Open;

   for I:=0 to ADODataSet1.Fields.Count-1 do
   begin
     ShowMessageFmt('%S:%S',[ADODataSet1.Fields.Fields[I].FieldName,ADODataSet1.Fields.Fields[I].ClassName]);
   end;

   //PASS
   {for iCount := 0 to ADOTable1.IndexDefs.Count - 1 do
   begin
     if ixprimary in ADOTable1.IndexDefs[iCount].Options then
     begin
       //PrimaryKey:=ADOTable1.IndexDefs.Items[0].Fields;
       //ShowMessage(PrimaryKey);
       //PrimaryKey := PrimaryKey + ADOTable1.IndexDefs.Items[iCount].Fields;
     end;
   end;}
end;

procedure TForm1.Btnx_2Click(Sender: TObject);
var
  I:Integer;              //VarArrayOf([Unassigned, Unassigned, Unassigned, Unassigned, 'TBL_GZ'])
begin
  //PASS:
  {ADOConnection1.OpenSchema(siColumns,VarArrayOf([Unassigned, Unassigned,  'TBL_GZ']), EmptyParam, ADODataSet1);

  for I:=0 to dbgrd1.Columns.Count-1 do
  begin
    dbgrd1.Columns.Items[I].Width:=60;
  end;}

  
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  RzSplitter1.Percent:=50;
end;

end.
